#ifndef _HUMAN_H
#define _HUMAN_H

#include "talk.h"
#include "idAlloc.h"

///////////////////////////////////////////////////////////////////
/// 华丽的分割线
////////////////////////////////////////////////////////////////////
class Human
{
	private:
		uint32 id;						/// id
		std::string name;			/// 姓名
		uint8 sex;						/// 性别
		uint8 age;						/// 年龄
		uint8 emotion;				/// 情感
		uint32 lover;					/// 爱人
		bool married;					/// 是否结婚
	public:
		Human(uint32 tid = 0, std::string tname = "", uint8 tsex = SEX_MALE)
				: id(tid), name(tname), sex(tsex)
		{
			age = 0;
			lover = 0;
			married = false;
			emotion = EMOTION_CRY;
			if(this->id == 0)
			{
				std::cout << "this baby has not a id!!" << std::endl;
			}
			std::cout << this->name << " borned." << std::endl;
		}
		~Human() {}

		void setID(const uint32 &id)
		{
			if(id != 0) this->id = id;
		}
		void setName(const std::string &name)
		{
			if(name != "") this->name = name;
		}
		void setEmotion(const uint8 &emotion)
		{
			if(emotion != 0) this->emotion = emotion;
		}
		bool setLover(uint8 id);
		bool setMarrage(uint8 id)
		{
			if(setLover(id))
			{
				this->married = true;
			}
			else
			{
				this->married = false;
			}
			return this->married;
		}
		void usetMarrage()
		{
			this->married = false;
		}
		uint32 getID()
		{
			return this->id;
		}
		std::string getName()
		{
			return this->name;
		}
		uint8 getSex()
		{
			return this->sex;
		}
		uint8 getEmotion()
		{
			return this->emotion;
		}
		uint8 getLover()
		{
			return this->lover;
		}

		void talk(const uint8 saying, uint32 id);
		void getTalk(const uint8 saying, uint32 id);

		Human* birth(const std::string &name);
};

#endif
